from PIL import Image

# Open an image
img = Image.open("example.jpg")

# Display the image
img.show()

# Print image details
print(f"Format: {img.format}, Size: {img.size}, Mode: {img.mode}")